<?php
/**
 * Created by IntelliJ IDEA
 * Author: 张伯发
 * Date  : 2019/11/21
 * Time  : 10:29
 */

namespace Xiaoproject\Common\Json;


class Mapper extends \JsonMapper {


    /**
     * Map data all data in $json into the given $object instance.
     *
     * @param string $json
     * @param object $object Object to map $json data into
     *
     * @return object Mapped object is returned.
     * @see    mapArray()
     */
    public function map($json, $object)
    {
        if (is_string($json)) $json = json_decode($json);

        return parent::map($json, $object);
    }
}
